﻿using Abp.Application.Services;
using Abp.AspNetCore.Mvc.Authorization;
using AbpZeroTemplate.MultiTenancy;
using AbpZeroTemplate.MultiTenancy.Dto;
using AbpZeroTemplate.Web.Controllers;
using AbpZeroTemplate.Web.Swagger;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace AbpZeroTemplate.Api.Admin.Controllers
{
    /// <summary>租户注册
    /// </summary>
    [Area("Admin")]
    [Route("Admin/TenantRegistration/[action]")]
    [ApiName("Admin")]
    [RemoteService]
    [AbpMvcAuthorize]
    public class TenantRegistrationController : AbpZeroTemplateControllerBase
    {
        private readonly ITenantRegistrationAppService _tenantRegistrationAppService;
        /// <summary>
        /// </summary>
        public TenantRegistrationController(ITenantRegistrationAppService tenantRegistrationAppService)
        {
            _tenantRegistrationAppService = tenantRegistrationAppService;
        }

        /// <summary>注册租户
        /// </summary>
        [HttpPost]
        public async Task<RegisterTenantOutput> RegisterTenant([FromBody]RegisterTenantInput input)
        {
            return await _tenantRegistrationAppService.RegisterTenant(input);
        }


    }
}
